<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/MainTemplate.Master" AutoEventWireup="true" CodeBehind="CreateNewUser.aspx.cs" Inherits="AlexandriaPressWebsite.MasterPages.UserPages.CreateNewUser" %>
<asp:Content ID="Content1" ContentPlaceHolderID="mainDoc" runat="server">
    <asp:Label ID="regStatLabel" runat="server" CssClass="parag"></asp:Label>
    <br />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="formDoc" runat="server">
 <h1>Sign up for your new account!</h1>
 <br/>
 <br/>
    <table border="0" id="registrationTable">                           
                             <tr>
                                <td align="right">
                                    <asp:Label ID="FirstNameLabel1" runat="server" AssociatedControlID="FirstName" 
                                        CssClass="simplelabel">First Name:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="FirstName" runat="server" ValidationGroup="createNewUser"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="FirstNameRequired" runat="server" 
                                        ControlToValidate="FirstName" ErrorMessage="First Name is required." 
                                        ToolTip="First Name is required." ValidationGroup="createNewUse">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            
                             <tr>
                                <td align="right">
                                    <asp:Label ID="LastNameLabel1" runat="server" AssociatedControlID="LastName" 
                                        CssClass="simplelabel">Last Name:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="LastName" runat="server" ValidationGroup="createNewUse"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="LastNameRequired" runat="server" 
                                        ControlToValidate="LastName" ErrorMessage="Last Name is required." 
                                        ToolTip="Last Name is required." ValidationGroup="createNewUse">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            
                            <tr>
                                <td align="right"> 
                                <asp:Label ID="GenderLabel1" runat="server" AssociatedControlID="Gender" 
                                        CssClass="simplelabel">Gender:</asp:Label>                               
                                </td>
                                <td>
                                 <asp:DropDownList ID="Gender" runat="server" Width="165px" 
                                        ValidationGroup="createNewUse">
                                        <asp:ListItem Value="Female">Female</asp:ListItem>
                                        <asp:ListItem Value="Male">Male</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            
                            <tr>
                                <td align="right">
                                    <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email" 
                                        CssClass="simplelabel">E-mail:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="Email" runat="server" ValidationGroup="createNewUse"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="EmailRequired" runat="server" 
                                        ControlToValidate="Email" ErrorMessage="E-mail is required." 
                                        ToolTip="E-mail is required." ValidationGroup="createNewUse">*</asp:RequiredFieldValidator>
                                    <asp:Label ID="emailExists" runat="server" ForeColor="Red" 
                                        Text="E-mail address already exists." Visible="False"></asp:Label>
                                </td>
                            </tr>
                            
                            <tr>
                                <td align="right">
                                    <asp:Label ID="BirthdayLabel1" runat="server" AssociatedControlID="Birthday" 
                                        CssClass="simplelabel">Birthday:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="Birthday" runat="server" ValidationGroup="createNewUse"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="BirthdayRequired" runat="server" 
                                        ControlToValidate="Birthday" ErrorMessage="Birthday is required." 
                                        ToolTip="Birthday is required." ValidationGroup="createNewUse">*</asp:RequiredFieldValidator>
                                    <asp:Label ID="dateStatLabel" runat="server" ForeColor="Red"></asp:Label>
                                </td>
                            </tr>
                            
                           <tr>
                                <td align="right">
                                    <asp:Label ID="DeliveryAddLabel1" runat="server" 
                                        AssociatedControlID="DeliveryAdd" CssClass="simplelabel">Delivery Address:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="DeliveryAdd" runat="server" ValidationGroup="createNewUse" 
                                        Width="168px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="DeliveryAddRequired" runat="server" 
                                        ControlToValidate="DeliveryAdd" ErrorMessage="Delivery Address is required." 
                                        ToolTip="Delivery Address is required." ValidationGroup="createNewUse">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            
                            <tr>
                                <td align="right">
                                    <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName" 
                                        CssClass="simplelabel">User Name:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="UserName" runat="server" ValidationGroup="createNewUse"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" 
                                        ControlToValidate="UserName" ErrorMessage="User Name is required." 
                                        ToolTip="User Name is required." ValidationGroup="createNewUse">*</asp:RequiredFieldValidator>
                                    <asp:Label ID="usernameExists" runat="server" ForeColor="Red" 
                                        Text="Username already exists." Visible="False"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password" 
                                        CssClass="simplelabel">Password:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="Password" runat="server" TextMode="Password" 
                                        ValidationGroup="createNewUse"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" 
                                        ControlToValidate="Password" ErrorMessage="Password is required." 
                                        ToolTip="Password is required." ValidationGroup="createNewUse">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="ConfirmPasswordLabel" runat="server" 
                                        AssociatedControlID="ConfirmPassword" CssClass="simplelabel">Confirm Password:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password" 
                                        ValidationGroup="createNewUse"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" 
                                        ControlToValidate="ConfirmPassword" 
                                        ErrorMessage="Confirm Password is required." 
                                        ToolTip="Confirm Password is required." ValidationGroup="createNewUse">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
          
                            <tr>
                                <td align="right">
                                    <asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question" 
                                        CssClass="simplelabel">Security Question:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="Question" runat="server" ValidationGroup="createNewUse"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="QuestionRequired" runat="server" 
                                        ControlToValidate="Question" ErrorMessage="Security question is required." 
                                        ToolTip="Security question is required." ValidationGroup="createNewUse">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer" 
                                        CssClass="simplelabel">Security Answer:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="Answer" runat="server" ValidationGroup="createNewUse"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="AnswerRequired" runat="server" 
                                        ControlToValidate="Answer" ErrorMessage="Security answer is required." 
                                        ToolTip="Security answer is required." ValidationGroup="createNewUse">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>                                                       
                            <tr>
                                <td align="center" colspan = "2">
                                    <asp:CheckBox ID="AgreeCheckBox" runat="server" Text="I agree to the" 
                                        CssClass="checkbox" ValidationGroup="createNewUse" />
&nbsp;<asp:LinkButton ID="termsAndConditionsLink" runat="server" CausesValidation="False" 
                                        PostBackUrl="~/MasterPages/TermsConditions.aspx" 
                                        ValidationGroup="createNewUse">Alexandria Press Terms and Conditions.</asp:LinkButton>
                                </td>
                            </tr>
                            
                            <tr>
                                <td align="center" colspan="2">
                              <asp:Button ID="createAccountButton" runat="server" 
                                Text="Create Account" onclick="createAccountButton_Click" 
                                        ValidationGroup="createNewUse" />
    
                                </td>
                            </tr>
                            
                            <tr>
                                <td align="center" colspan="2">
                                    <asp:RegularExpressionValidator ID="EmailRegEx" runat="server" 
                                        ControlToValidate="Email" ErrorMessage="Incorrect Email format." 
                                        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
                                        ValidationGroup="createNewUse"></asp:RegularExpressionValidator>
                                </td>
                            </tr>
                            
                              <tr>
                                <td align="center" colspan="2">
                                    <asp:RegularExpressionValidator ID="bdayRegEx" runat="server" 
                                        ControlToValidate="Birthday" ErrorMessage="MM-DD-YYYY" 
                                        ValidationExpression="[\d][\d]\-[\d][\d]\-[\d][\d][\d][\d]" 
                                        ValidationGroup="createNewUse"></asp:RegularExpressionValidator>
                                </td>
                            </tr>
                            
                            <tr>
                                <td align="center" colspan="2">
                                    <asp:CompareValidator ID="PasswordCompare" runat="server" 
                                        ControlToCompare="Password" ControlToValidate="ConfirmPassword" 
                                        Display="Dynamic" 
                                        ErrorMessage="The Password and Confirmation Password must match." 
                                        ValidationGroup="createNewUse"></asp:CompareValidator>
                                </td>
                            </tr>
                            
                           <tr>
                                <td align="center" colspan="2">
                                    <asp:RegularExpressionValidator ID="passwordRegEx" runat="server" 
                                        ControlToValidate="Password" 
                                        ErrorMessage="Include at least one number. Minimum password length of 7." 
                                        ValidationExpression="^.*(?=.{7})(?=.*\d)(?=.*[a-zA-Z]).*$" 
                                        ValidationGroup="createNewUse"></asp:RegularExpressionValidator>
                                </td>
                           </tr>
                            
                            <tr>
                                <td align="center" colspan="2" style="color:Red;">
                                    <asp:Label ID="DisagreeLabel" runat="server" 
                                        Text="You have not agreed to the Alexandria Press Terms and Conditions." 
                                        Visible="False"></asp:Label>
                                </td>
                            </tr>
                        </table>
                        <br/>
</asp:Content>
